public class PC {
    private CPU cpu;
    private HardDisk HD;
    void setCPU(CPU c)
    {
        cpu = c;
    }
    void setHardDisk(HardDisk h)
    {
        HD = h;
    }
    void show()
    {
        System.out.println("CPU的速度和硬盘的容量是: "+cpu.getSpeed() + "和" + HD.getAmount());
    }
}
